﻿#ifndef QLUOSHUAPPLICATION_H
#define QLUOSHUAPPLICATION_H

#include <QApplication>
#include <QAction>
#include <QSettings>
#include <constants.h>

class QLuoshuApplication : public QApplication
{
	Q_OBJECT

public:
	QLuoshuApplication(int &argc, char **argv);
	~QLuoshuApplication();

    QAction* getDebugAction(){return m_pDebugAction;}
    inline QSettings* getSettings(){return m_setting;}

	static void userDebugHandler(QtMsgType type, const char *pMsg );
    // get the root dir
    QString getRootDocDir(){return m_setting->value(INI_ROOT_DIR,QVariant("")).toString();}
public slots:
	void installDebugHandler();

private:
	QAction*      m_pDebugAction;
	QtMsgHandler    m_oldMsgHandler;
    QSettings*  m_setting;
	int isDebuging;
	void emitMySianal(QtMsgType type,QString sentence);

signals:
	void incomingMsg(QtMsgType type,QString sentence);
	
};

#endif // QLUOSHUAPPLICATION_H
